package com.bcxk.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bcxk.entity.dto.Comment;
import com.bcxk.mapper.CommentMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class CommentService extends ServiceImpl<CommentMapper, Comment> {
    @Transactional(readOnly = true)
    public List<Comment> getCommentsByMinSuId(Long minsuId) {
        QueryWrapper<Comment> wrapper = new QueryWrapper<>();
        wrapper.lambda().eq(Comment::getMinsuId,minsuId);
        return this.list(wrapper);
    }
}
